package com.oneplatform.permission.dao.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.mendmix.common.model.IdNamePair;
import com.oneplatform.permission.dto.ObjectRelation;

public interface ObjectRelationMapper {
	
	int insertGrantRelation(List<ObjectRelation> relations);
	
	int insertBindingRelation(List<ObjectRelation> relations);
	
	int insertSubordinateRelation(List<ObjectRelation> relations);
	
	int deleteGrantRelation(ObjectRelation relation);
	
	int deleteBindingRelation(ObjectRelation relation);
	
	int deleteSubordinateRelation(ObjectRelation relation);
	
	List<ObjectRelation> findGrantRelations(ObjectRelation example);
	
	List<ObjectRelation> findBindingRelations(ObjectRelation example);
	
	List<ObjectRelation> findSubordinateRelations(ObjectRelation example);
	
	List<IdNamePair> findSubChildIdNamePairs(@Param("relationType") String relationType,@Param("parentId") String parentId);
}